#include <STC15F2K60S2.H>

unsigned char  code Seg_date[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff,0xbf,0xc6,0x86,0x89};
unsigned char  code Seg_wela[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

void Seg_disp(unsigned char addr,unsigned char date,unsigned char point)
{
	P0=0Xff;//段选消影
	P2=P2&0x1f | 0xe0;
	P2&=0x1f;
	
	P0=Seg_wela[addr];//位选
	P2=P2&0x1f | 0xc0;
	P2&=0x1f;
	
	P0=Seg_date[date];//段选
	if(point)
		P0&=0x7f;
	P2=P2&0x1f | 0xe0;
	P2&=0x1f;
}